﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>IupSplit</title>

<link rel="stylesheet" type="text/css" href="../../style.css">
<style type="text/css">
.style1 {
	font-size: large;
}
</style>
</head>
<body>
<div id="navigation">
  <ul>
    <li><a href="#Creation">Creation</a></li>
    <li><a href="#Attributes">Attributes</a></li>
    <li><a href="#Callbacks">Callbacks</a></li>
    <li><a href="#Notes">Notes</a></li>
    <li><a href="#Examples">Examples</a></li>
    <li><a href="#SeeAlso">See Also</a></li>
  </ul>
</div>

<h2>IupSplit <span class="style1">(since 3.1)</span></h2>
<p>Creates a void container that split its client area in two. Allows the provided controls to be 
enclosed in a box that allows expanding and contracting the element <strong>size</strong> in one 
direction, but when one is expanded the other is contracted.</p>

  <p>
  It does not have a native representation, but it contains also a <strong>IupFlatSeparator</strong> to implement 
	the bar handler.</p>

<h3><a name="Creation">Creation</a></h3>

<pre>Ihandle* IupSplit(Ihandle*<strong> child1</strong>, Ihandle*<strong> child2</strong>); [in C]
iup.split{<strong>child1</strong>, <strong>child2</strong>: ihandle} -&gt; (<strong>ih</strong>: ihandle) [in Lua]
split(<strong>child1</strong>, <strong>child2</strong>) [in LED]</pre>
  <p><strong>child1</strong>: Identifier of an interface element that will be at 
  left or top. It can be NULL (nil in Lua), or empty in LED.<br>
	<strong>child2</strong>: Identifier of an interface element that will be at 
  right or bottom. It can be NULL (nil in Lua), or empty in LED.</p>
  <p>
  <u>Returns:</u> the identifier of the 
  created element, or NULL if an error occurs.</p>

<h3><a name="Attributes">Attributes</a></h3>


<p><strong>AUTOHIDE</strong> (<font SIZE="3">non inheritable</font>): if the 
child client area is smaller than the bar size, then automatically hide the 
child. Default: NO.</p>
<p><strong>BARSIZE</strong> (<font SIZE="3">non inheritable</font>): controls 
the size of the bar handler. Default: 5.</p>
<p><strong>COLOR</strong>: Changes the color of the
  bar grip affordance. Default: &quot;160 160 160&quot;.</p>


<p><strong>ORIENTATION</strong> (creation only) (<font SIZE="3">non inheritable</font>): Indicates the orientation of the bar handler. 
The direction of the resize is perpendicular to the orientation. Possible values are &quot;VERTICAL&quot; or &quot;HORIZONTAL&quot;. Default: &quot;VERTICAL&quot;.</p>
<p><a href="../attrib/iup_expand.html">EXPAND</a> (<font SIZE="3">non inheritable</font>): 
The default value is &quot;YES&quot;.</p>
<p><strong>LAYOUTDRAG</strong> (<font SIZE="3">non inheritable</font>): When the 
bar is moved automatically update the children layout. Default: YES. If set to 
NO then the layout will be updated only when the mouse drag is released.</p>
<p><strong>MINMAX</strong> (<font SIZE="3">non inheritable</font>): sets minimum 
and maximum crop values for VALUE, in the format &quot;%d:%d&quot; [min:max]. The min 
value can not be less than 0, and the max value can not be larger than 1000. 
This will constrain the interactive change of the bar handler. Default: 
&quot;0:1000&quot;. (Since 3.2)</p>
<p><strong>SHOWGRIP</strong> (<font SIZE="3">non inheritable</font>): Shows the 
bar grip affordance. Default: YES. When set to NO, the BARSIZE is set to 3. When 
set to NO, COLOR is used to fill the grip area (since 
3.11.1) if defined, if COLOR is not defined the area is filled with the parent 
background color. If set to "LINES" then instead of the traditional grip appearance, it 
will be two parallel lines (since 3.11.1). </p>
<p><strong>VALUE</strong> (<font SIZE="3">non inheritable</font>): The proportion of the left or 
top (child1) client area relative to the full available area. It is an 
integer between 0 and 1000. If not defined or set to NULL, the Native size of 
the two children will define its initial size.</p>

  <p><b>WID</b> (read-only): returns -1 if mapped.</p>

  <blockquote>
    <hr>
</blockquote>

  <p>
<a href="../attrib/iup_font.html">FONT</a>,
    <a href="../attrib/iup_size.html">SIZE</a>,
<a href="../attrib/iup_rastersize.html">RASTERSIZE</a>,
<a href="../attrib/iup_clientsize.html">CLIENTSIZE</a>, 
	<a href="../attrib/iup_clientoffset.html">CLIENTOFFSET</a>, 
	<a href="../attrib/iup_position.html">POSITION</a>, 
<a href="../attrib/iup_minsize.html">
MINSIZE</a>, <a href="../attrib/iup_maxsize.html">
MAXSIZE</a>, <a href="../attrib/iup_theme.html">THEME</a>: 
also accepted.</p>

<h3><a name="Callbacks">Callbacks</a></h3>


<p><strong>VALUECHANGED_CB</strong>:
  Called after the value was interactively changed by the user. (since 3.12)</p>

<pre>int function(Ihandle *<strong>ih</strong>); [in C]<br><strong>ih</strong>:valuechanged_cb() -&gt; (<strong>ret</strong>: number) [in Lua]</pre>

    
<p class="info"><strong>ih</strong>:
  identifier of the element that activated the 
  event.</p>

<h3>Notes</h3>
<p>The controls that you want to be resized must have the EXPAND=YES attribute 
set. See the <a href="../layout_guide.html">Layout Guide</a> for mode details 
  on sizes.</p>
<p>If you set the MINMAX attribute for a direct child, <strong>IupSplit</strong> 
will respect that size. Nested children will also have their size limits 
respected.</p>
<p>The <strong>IupFlatSeparator</strong> bar handler is always the first child of the 
split. It can be obtained using <strong>IupGetChild</strong> or <strong>
IupGetNextChild</strong>.</p>
<p>The <strong>IupSplit</strong> control looks just like the <strong>IupSbox</strong>, 
but internally is very different. While the <strong>IupSbox </strong>controls only one element and can 
push other elements outside the dialog, the <strong>IupSplit</strong> balance its internal size and 
never push other elements outside its boundaries.</p>
<p>When AUTOHIDE=Yes the control will set FLOATING=IGNORE and VISIBLE=NO for the 
child to be auto-hidden, then back to FLOATING=NO and VISIBLE=Yes when shown. So 
if the child has several children with different combinations of VISIBLE it is 
recommended that this child to be a native container like <strong>
IupBackgroundBox</strong> or <strong>IupFrame,</strong> so the VISIBLE attribute 
will be not be propagated to its children.</p>

<p>The container can be created with no elements and be dynamic filled using
  <a href="../func/iupappend.html">IupAppend</a> or
<a href="../func/iupinsert.html">IupInsert</a>.</p>


<h3><a name="Examples">Examples</a></h3>
<p><a href="../../examples/">Browse for Example Files</a></p>

<div align="center">
  <center>
  <table border="0" cellpadding="6" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
    <tr>
      <td><img border="0" src="images/iupsplit1.png"><br>
		Natural Size</td>
      <td><img border="0" src="images/iupsplit2.png"><br>
		After Moving the Split Bar</td>
    </tr>
  </table>
  </center>
</div>

</body>

</html>
